﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


class MaximalIncreasingSequence
{
    static void Main()
    {
        int[] array = new int[20]; //{ 3, 0, 1, 2, 3, 4, 5, 6, 2, 2, 4 };
        
        for (int counter = 0; counter < array.Length; counter++)
        {
            array[counter] = int.Parse(Console.ReadLine());
        }

        int maxSequence = 1;
        int tempSequence = 0;
        int currentElement = array[0];

        for (int counter = 1; counter < array.Length; counter++)
        {
            if (currentElement + 1 == array[counter])
            {
                tempSequence++;
            }
            else
            {
                tempSequence = 1;
            }

            if (tempSequence >= maxSequence)
            {
                maxSequence = tempSequence;
            }

            currentElement = array[counter];
        }
        Console.WriteLine();
        Console.WriteLine(maxSequence);
    }
}


